<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
	</head>
	<body>
		<script type="text/javascript">
			function fn(a) {
				// setTimeout(function(){console.log("abc")},3000);
				// new Promise(function(resolve,reject){})
				return new Promise((resolve, reject) => {
					setTimeout(() => resolve(a), 3000);
				})
			}

			// fn();

			async function ajax() {
				const r1 = await fn('1');
				console.log("r1=" + r1);
				const r2 = await fn(r1 * 2);
				console.log("r2=" + r2);
				const r3 = await fn(r2 * 2);
				console.log("r3=" + r3);
				const r4 = await fn(r3 * 2);
				console.log("r4=" + r4);
			}

			ajax();
		</script>
	</body>
</html>
